<?php

namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class FailFriend extends Model
{
    protected $table = 'wy_fail_friend';
    public $timestamps = false;
    protected $primaryKey = 'id';

    public static function getRows($where = [], $feild = '*', $with = [])
    {
        $datas = self::select($feild)->where($where);
        // 关联查询
        if (is_array($with) && !empty($with))
            foreach ($with as $value)
                $datas = $datas->with($value);

        $datas = $datas->first();
        return $datas;
    }

}
